package com.techstar.ats.codec.history.decoder;

import io.netty.buffer.ByteBuf;
import com.techstar.ats.codec.Decoder;
import com.techstar.ats.codec.StringCodec;
import com.techstar.ats.dxp.history.F16GroupBak;
import com.techstar.ats.type.BakType;
import com.techstar.ats.type.DepotType;

public enum F16GroupBakDecoder implements Decoder<F16GroupBak> {
	INSTANCE;

	public F16GroupBak create() {
		return new F16GroupBak();
	}

	public void decode(ByteBuf buf, F16GroupBak value) {
		value.group = (new StringCodec(9)).get(buf);
		value.status = BakType.valueOf(buf.readUnsignedByte());
		value.depot = DepotType.valueOf(buf.readUnsignedByte());
		value.trackName = (new StringCodec(20)).get(buf);
	}
}
